const ENV = import.meta.env.VITE_APP_ENV
import {isEmptyValue} from '@/utils/util'
const CONFIG = {
  // storage接口地址
  storageUrls: {
    development: 'https://storage-dev.infinitus.com.cn',
    test: 'https://storage-test.infinitus.com.cn',
    staging: 'https://storage-staging.infinitus.com.cn',
    production: 'https://storage.infinitus.com.cn'
  },

  // 静态资源上传Key
  upLoadKey: {
    development: { // dev环境
      access_key: 'xyq2xdbrzw58zglZOJgTBgwJTZ6cXMnHgpAJvngu',
      secret_key: 'XqM0afnrlciWLwe5rw93R3MaVzKInyhy8nG5DKhY'
    },
    test: { // test 环境
      access_key: 'l4OpwyRbiaj9ErX49gpGSv7HjdzqB81AArXRbgL2',
      secret_key: 'hEaz1RnGZ7Me7sYPvyvAzduW2LsKK9lwZGPC8jsB'
    },
    staging: { // stg 环境
      access_key: 'WGrHdkCo4AbQwPjBSvGfchhn7wcefnAEvavbkAFv',
      secret_key: 'Sf9gijbIrzRuPcSiDMh3gowFTn1iKsvCLxCkqbVq'
    },
    production: { // 生产环境
      access_key: '',
      secret_key: ''
    }
  }
}

export function getConfig(configName, env = ENV) {
  if(isEmptyValue(configName)){
    new Error('请传入需要获取的参数名')
    return
  }
  return CONFIG[configName][env]
}
